/*
 * @Author: shanghongyun 2879455630@qq.com
 * @Date: 2025-06-28 14:25:40
 * @LastEditors: shanghongyun 2879455630@qq.com
 * @LastEditTime: 2025-07-04 09:22:57
 * @FilePath: \A06\Device\GPIO.c
 * @Description: GPIO配置
 */



#include "dev.h"


/**
 * @description: GPIO配置 无复用功能
 * @return {*}
 */
void gpio_config(void){
    /*按键*/
    GPIO_InitTypeStruct gpioInitStr;
    gpioInitStr.GPIO_Pin = KEYR_PIN;
    gpioInitStr.GPIO_Mode = GPIO_MODE_INPUT;
    gpioInitStr.GPIO_OType = GPIO_OTYPE_PP;
    gpioInitStr.GPIO_Speed = GPIO_SPEED_HIGH;
    gpioInitStr.GPIO_PuPd = GPIO_PUPD_UP;
    GPIO_Init(KEYR_PORT , &gpioInitStr);

    gpioInitStr.GPIO_Pin = KEYL_PIN;
    GPIO_Init(KEYL_PORT , &gpioInitStr);

    /*充电开启/关闭*/
    gpioInitStr.GPIO_Pin = CHARGE_L_PIN;
    gpioInitStr.GPIO_Mode = GPIO_MODE_OUTPUT;
    gpioInitStr.GPIO_PuPd = GPIO_PUPD_NOPULL;
    gpioInitStr.GPIO_OType = GPIO_OTYPE_PP;
    GPIO_Init(CHARGE_L_PORT , &gpioInitStr);

    gpioInitStr.GPIO_Pin = CHARGE_R_PIN;
    GPIO_Init(CHARGE_R_PORT , &gpioInitStr);

    DIS_CHARGE_L();
    DIS_CHARGE_R();

    /*数码屏*/
    gpioInitStr.GPIO_Pin = DISPLAY_SCL_PIN;
    gpioInitStr.GPIO_OType = GPIO_OTYPE_OD;
    GPIO_Init(DISPLAY_SCL_PORT , &gpioInitStr);

    gpioInitStr.GPIO_Pin = DISPLAY_SDA_PIN;
    GPIO_Init(DISPLAY_SDA_PORT , &gpioInitStr);
}



